<?php

// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );

// Import library dependencies
jimport('joomla.plugin.plugin');

class plgSystemKetnoi extends JPlugin {
  
	// Constructor
    function plgSystemKetnoi(&$subject, $params) {
    	$app = JFactory::getApplication();
    	if($app->isAdmin()) return;
    	$user = JFactory::getUser();
    	$tmpl = JRequest::getVar("tmpl");
    	//$component = JRequest::getVar("option");
    	$view = JRequest::getVar("view");
    	if($user->guest && $tmpl != "login")
    	{
    		header("Location:".JUri::root(true)."/index.php?option=com_ketnoi&view=login&tmpl=login");
    	}
		
		parent::__construct( $subject, $params );
    }

}